﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace estudent.Controllers
{
    public class MainController : Controller
    {
        //
        // GET: /Main/

        public ActionResult Index()
        {
            //temp
           //Session["Name"] = "refer";
           //Session["Role"] = "refe";

            if (Session["Name"] == null)
            {
                return RedirectToAction("index","Login");
            }
            else
            {
                string role=Session["Role"].ToString();
                if (role.CompareTo("stud") == 0)
                {
                    return View("StudentPage");
                }
                else if (role.CompareTo("refe") == 0)
                {
                    return View("ReferPage");
                }
                else if (role.CompareTo("admi") == 0)
                {
                    return View("AdminPage");
                }
                else if (role.CompareTo("prof") == 0)
                {
                    return View("ProfPage");
                }
                else
                    return Content("Vstop je prepovedan, neznana vloga uporabnika.");
            }
        }

    }
}
